<template>
    <div class="navbar">
        <el-menu :default-active="route.fullPath" :router="true" class="el-menu-demo" mode="horizontal">
            <el-menu-item index="/">内容中心</el-menu-item>
            <el-menu-item index="/product">资源中心</el-menu-item>
        </el-menu>
        <div class="right" @click="handleClick">后台登录</div>
    </div>
</template>

<script setup>
import { useRoute } from 'vue-router';
const route = useRoute();

//跳转
const handleClick = () => {
    window.location = 'http://127.0.0.1:8080';
};
</script>

<style lang="scss" scoped>
.navbar {
    position: sticky;
    top: 0px;
    z-index: 1000;
}
.right {
    cursor: pointer;
    position: fixed;
    top: 0;
    right: 20px;
    width: 100px;
    height: 60px;
    line-height: 60px;
    font-weight: 900;
    text-align: center;
}
</style>
